package yesjava;

import java.util.Arrays;
import java.util.List;
import java.util.function.UnaryOperator;

public class Test8 {
    public static void main(String[] args) {
        List<String> stringList = Arrays.asList(new String[]{"美国","中国", "日本", "加拿大", "英国", "越南", "缅甸"});
        stringList.replaceAll(s->  s.equals("日本")?"小日本":s  );
       /* stringList.replaceAll(new UnaryOperator<String>() {
            @Override
            public String apply(String s) {
                return s.equals("日本")?"小日本":s;
            }
        });*/
        System.out.println(stringList);

    }
}
